package abq2.jic.jic.plugin.form;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.form.events.BeforeDoOperationEventArgs;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.orm.query.QFilterEvaluator;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;

/**
 * 单据界面插件
 */
public class TestTestTest extends AbstractBillPlugIn implements Plugin {
    @Override
    public void beforeDoOperation(BeforeDoOperationEventArgs args) {
        super.beforeDoOperation(args);
        DynamicObject[] load = BusinessDataServiceHelper.load("abq2_test_1111",
                "abq2_mulbasedatafield",
                null);
        DynamicObject[] load1 = BusinessDataServiceHelper.load("abq2_books_info",
                "abq2_textfield",
                new QFilter("abq2_textfield",QCP.equals,"余华").toArray());
        DynamicObjectCollection dynamicObjects = new DynamicObjectCollection();
        for (DynamicObject dynamicObject : load1) {
            dynamicObjects.add(dynamicObject);
        }
        this.getModel().setValue("abq2_mulbasedatafield",dynamicObjects);
        System.out.println(load.toString());
        DynamicObject abq2_basedatafield = (DynamicObject)this.getModel().getValue("abq2_basedatafield");
        System.out.println(abq2_basedatafield
        );
    }
}